/*
 * @Description: 基础流程模型xml
 * @Author: DHL
 * @Date: 2022-04-20 13:39:06
 * @LastEditors: DHL
 * @LastEditTime: 2022-08-25 16:16:52
 */
export default (key: string, name: string, category: string, description: string, type = 'flowable') => {
  if (!type) type = 'flowable'

  const TYPE_TARGET: any = {
    activiti: 'http://activiti.org/bpmn',
    camunda: 'http://bpmn.io/schema/bpmn',
    flowable: 'http://flowable.org/bpmn'
  }

  return `
  <?xml version="1.0" encoding="UTF-8"?>
  <bpmn2:definitions 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL"
    xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
    xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
    xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
    id="diagram_${key}"
    targetNamespace="${category}">

    <bpmn2:process id="${key}" name="${name}" isExecutable="true">
      <bpmn2:documentation>${description}</bpmn2:documentation>
    </bpmn2:process>
    
    <bpmndi:BPMNDiagram id="BPMNDiagram_1">
      <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="${key}">
      </bpmndi:BPMNPlane>
    </bpmndi:BPMNDiagram>

  </bpmn2:definitions>
  `
}
